package com.zbkj.front.model.vo;

import com.zbkj.dal.entity.fund.UserQuotaChangeRecord;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@ApiModel
public class QuotaOrderInfoVO {

    @ApiModelProperty("额度流水号")
    private String quotaNo;

    @ApiModelProperty("用户id")
    private Integer userId;

    @ApiModelProperty("额度账户id")
    private Integer quotaId;

    @ApiModelProperty("额度账号")
    private String quotaAccount;

    @ApiModelProperty("业务单号")
    private String bizOrderNo;

    @ApiModelProperty("变动额度")
    private BigDecimal quotaChangeAmount;

    @ApiModelProperty("image")
    private String image;

    @ApiModelProperty("变动方向")
    private Integer changeDirection;

    @ApiModelProperty("变动类型")
    private String changeType;

    @ApiModelProperty("变动前额度总额")
    private BigDecimal oldQuotaTotal;

    @ApiModelProperty("变动后额度总额")
    private BigDecimal newQuotaTotal;

    @ApiModelProperty("变动前额度可用")
    private BigDecimal oldQuotaBalance;

    @ApiModelProperty("变动后额度可用")
    private BigDecimal newQuotaBalance;

    @ApiModelProperty("变动前额度已用")
    private BigDecimal oldQuotaUsed;

    @ApiModelProperty("变动后额度已用")
    private BigDecimal newQuotaUsed;

    @ApiModelProperty("status")
    private String status;

    @ApiModelProperty("记账时间")
    private LocalDate billDate;

    @ApiModelProperty("签名")
    private String signature;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("remark")
    private String remark;

    public static QuotaOrderInfoVO transform(UserQuotaChangeRecord record) {
        QuotaOrderInfoVO quotaOrderInfoVO = new QuotaOrderInfoVO();
        quotaOrderInfoVO.setQuotaNo(record.getQuotaNo());
        quotaOrderInfoVO.setUserId(record.getUserId());
        quotaOrderInfoVO.setQuotaId(record.getQuotaId());
        quotaOrderInfoVO.setQuotaAccount(record.getQuotaAccount());
        quotaOrderInfoVO.setBizOrderNo(record.getBizOrderNo());
        quotaOrderInfoVO.setQuotaChangeAmount(record.getQuotaChangeAmount());
        quotaOrderInfoVO.setImage(record.getImage());
        quotaOrderInfoVO.setChangeDirection(record.getChangeDirection());
        quotaOrderInfoVO.setChangeType(record.getChangeType());
        quotaOrderInfoVO.setOldQuotaTotal(record.getOldQuotaTotal());
        quotaOrderInfoVO.setNewQuotaTotal(record.getNewQuotaTotal());
        quotaOrderInfoVO.setOldQuotaBalance(record.getOldQuotaBalance());
        quotaOrderInfoVO.setNewQuotaBalance(record.getNewQuotaBalance());
        quotaOrderInfoVO.setOldQuotaUsed(record.getOldQuotaUsed());
        quotaOrderInfoVO.setNewQuotaUsed(record.getNewQuotaUsed());
        quotaOrderInfoVO.setStatus(record.getStatus());
        quotaOrderInfoVO.setBillDate(record.getBillDate());
        quotaOrderInfoVO.setSignature(record.getSignature());
        quotaOrderInfoVO.setCreateTime(record.getCreateTime());
        quotaOrderInfoVO.setRemark(record.getRemark());
        return quotaOrderInfoVO;
    }

}
